import { sequelize }  from './sequelize.js'
import {Blog} from '../model/Blog.js'

export async function sync() {
    
sequelize.authenticate().then(()=> console.log('连接成功'))
await sequelize.sync({ force: true })
//   let { Blog } = await import('../model/Blog.js')
  let blogs = [
    {
      // id: 1,
      title: 'Mqtt集成与设计',
      author: 'ProsperousEnding'
    },
    {
      // id: 2,
      title: 'AI与.NET技术实操系列（七）：使用Emgu CV进行计算机视觉操作',
      author: 'AI·NET极客圈'
    },
    {
      // id: 3,
      title: '使用Semantic Kernel框架和C#.NET 实现大模型Function Calling',
      author: 'Eric zhou'
    },
    {
      // id: 4,
      title: '使用Istio灰度发布',
      author: 'FuShudi'
    }
  ]
  Blog.bulkCreate(blogs)
}